<?php echo $this->getHtml()->openForm($this->util->getUrlByAct(), 'post'); ?>
<p>
  <label>管理组名<small></small></label>
  <?php echo $this->getHtml()->text('group_name', $this->data['group_name']); ?>
</p>

<p>
  <label>权限<small></small></label>
<?php
$hasAuth = ',' . $this->data['group_auth'] . ',';

echo $this->getHtml()->checkbox('auth[]', 'ALL', ($hasAuth === ',ALL,' ? true : false)), '所有权限', '&nbsp;&nbsp;&nbsp;&nbsp;';
echo '<br/>', "\n";
foreach ($this->auths as $module => $auths) {
	foreach ($auths as $controller => $auth) {
		foreach ($auth as $action => $label) {
			$router = $module . '-' . $controller . '-' . $action;
			$checked = (strpos($hasAuth, ',' . $router . ',') !== false) ? true : false;
			echo $this->getHtml()->checkbox('auth[]', $router, $checked), $label, '&nbsp;&nbsp;&nbsp;&nbsp;';
		}
		
		echo '<br/>', "\n";
	}
}
?>
</p>

<p>
  <?php echo $this->getHtml()->hidden('do', 'post'), "\n"; ?>
  <?php echo $this->getHtml()->submit('提交', '', array('class' => 'button blue')); ?>
  <?php echo $this->getHtml()->submit('重置', '', array('class' => 'button')); ?>
</p>
<?php echo $this->getHtml()->closeForm(); ?>